package com.nuanshui.heatedloan.msgcenter.apppush.filter;

import com.nuanshui.heatedloan.msgcenter.apppush.annotation.AppPushFilterProvider;
import com.nuanshui.heatedloan.msgcenter.apppush.bean.AppPushResult;
import com.nuanshui.heatedloan.msgcenter.apppush.bean.Invoker;
import com.nuanshui.heatedloan.msgcenter.facade.MsgRedDotStatusService;
import com.nuanshui.heatedloan.msgcenter.model.AppPushMessage;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 处理红点的过滤器
 * @param 
 * @author guohao
 * @date 2017年1月12日 下午3:41:10
 * @since $
 */
@AppPushFilterProvider(value="redDotFilter",order=200)
public class RedDotFilter  implements AppPushFilter{

	@Autowired
	private MsgRedDotStatusService msgRedDotStatusService;


	@Override
	public AppPushResult invoke(Invoker invoker, AppPushMessage appPushMessage) {

		AppPushResult appPushResult =  invoker.doInvoker(appPushMessage);
		if(appPushResult.isSuccess()) {//添加对应的红点
			List<String>  allUserIds = appPushMessage.getMsgBody().getDstUserIds();
	    	if(allUserIds.size()<=0) return appPushResult;

		}
		return appPushResult;
	}

}
